import request from '@/utils/request'

// 查询服务项列表
export function listServiceltem(query) {
  return request({
    url: '/business/serviceltem/list',
    method: 'get',
    params: query
  })
}

// 查询服务项详细
export function getServiceltem(id) {
  return request({
    url: '/business/serviceltem/' + id,
    method: 'get'
  })
}

// 新增服务项
export function addServiceltem(data) {
  return request({
    url: '/business/serviceltem',
    method: 'post',
    data: data
  })
}

// 修改服务项
export function updateServiceltem(data) {
  return request({
    url: '/business/serviceltem',
    method: 'put',
    data: data
  })
}

// 删除服务项
export function delServiceltem(id) {
  return request({
    url: '/business/serviceltem/' + id,
    method: 'delete'
  })
}
// 上架服务项
export function saleOnHandle(id) {
  return request({
    url: '/business/serviceltem/' + id,
    method: 'patch',
    headers: { cmd: 'saleOn' }
  })
}

// 下架服务项
export function  saleOffHandle(id) {
  return request({
    url: '/business/serviceltem/' + id,
    method: 'patch',
    headers: { cmd: 'saleOff' }
  })
}
